import base from './HttpBase'; // 导入接口域名列表
import axios from '../request/http'; // 导入http中创建的axios实例
import qs from 'qs'; // 根据需求是否导入qs模块
const article = {

    getElectricCars(data) {
        return axios.post(`${base.laow}/home/getElectricCars`, data)
    },
    getCommodity(id) {
        return axios.get(`${base.laow}/store/getCommodity?id=${id}`)
        //商城页面左侧推荐
        // if (id == 2) {

        return {
            title: '优质商品',
            list: [
                {
                    commodityName: '法雷奥/VALEO VALEO First(优选)',
                    id: '121',
                    imgurl: 'https://img3.tuhu.org/Images/BAOYANG/WP-VALEO-YXUXYG_001.JPG@110w_110h_100Q.jpg',
                    price: '100.00',
                },
                {
                    title: '傲龙 新款男女士偏光炫彩时尚铝镁弹簧镜腿太',
                    id: '11221',
                    imgurl: 'https://qjsc.oss-cn-beijing.aliyuncs.com/images/shop/223/gallery/2018/08/11/15339582664053.jpg?x-oss-process=image/resize,m_pad,limit_0,h_320,w_320',
                    price: '100.00',

                },
                {
                    title: '野马 摩托车电动车男女通用双镜片哈雷夏季防',
                    id: '112321',
                    imgurl: 'https://qjsc.oss-cn-beijing.aliyuncs.com/images/shop/223/gallery/2018/08/09/15337764114447.png?x-oss-process=image/resize,m_pad,limit_0,h_320,w_320',
                    price: '100.00',
                },
            ]
        }
        // } else if (id == 3) {

        // }

    },
    getAD(params) {
        return axios.get(`${base.laow}/AD/`, {
            params: { name: params }
        });
        if (params == 1) {
            return [
                {
                    url: "https://i1.mifile.cn/a4/xmad_14950995035103_fhWtH.jpg",
                    herf: "#"
                }
            ];
        } else if (params == 2) {
            return [
                {
                    url: "static/img/AD2-1.jpg",
                    herf: "#"
                },
                {
                    url: "static/img/AD2-2.jpg",
                    herf: "#"
                },
                {
                    url: "static/img/AD2-3.jpg",
                    herf: "#"
                }
            ];
        } else if (params == 3) {
            return [
                {
                    url:
                        "https://qjsc.oss-cn-beijing.aliyuncs.com/images/backend/gallery/2018/06/27/15300669672702.jpg",
                    herf: 'https://wx.tuhu.cn/vue/NaActivity/pages/home/index?id=D1CF945D'
                },
                {
                    url:
                        "https://qjsc.oss-cn-beijing.aliyuncs.com/images/backend/gallery/2018/08/15/15343201384097.jpg",
                    herf: 'https://item.tuhu.cn/promotion/tirelist/6288e3e6-6df8-4015-890e-44f2c1b28ca1.html'
                },
                {
                    url:
                        "https://qjsc.oss-cn-beijing.aliyuncs.com/images/backend/gallery/2018/08/21/15348370751469.jpg",
                    herf: 'https://wx.tuhu.cn/vue/NaActivity/pages/home/index?id=0249209F'
                },
                {
                    url:
                        "https://qjsc.oss-cn-beijing.aliyuncs.com/images/backend/gallery/2018/06/27/15300669672702.jpg",
                    herf: 'https://item.tuhu.cn/promotion/tirelist/353a09af-05aa-492a-9d96-af3a320e505b.html'
                }
            ]
        } else if (params == 4) {
            return [
                {
                    url:
                        "https://img2.tuhu.org/Home/Image/FkcbUP3AKun6-mPCBrOqvoLPDu-T_w479_h273.jpeg",
                    herf: "#"
                },
                {
                    url:
                        "https://img2.tuhu.org/Home/Image/A88D59CF9ACE2AA90F149133FF3EBF66.png",
                    herf: "#"
                },
                {
                    url:
                        "https://img2.tuhu.org/Home/Image/70748615685B96CA8A9A066866DA2680.jpg",
                    herf: "#"
                },
                {
                    url:
                        "https://img2.tuhu.org/Home/Image/D76B4F5CA683C597E32B7D2F3B31A693.png",
                    herf: "#"
                }
            ]
        } else if (params == 4658) {
            return [
                {
                    url:
                        "https://qjsc.oss-cn-beijing.aliyuncs.com/images/backend/gallery/2018/06/27/15300669672702.jpg",
                    herf: 'https://wx.tuhu.cn/vue/NaActivity/pages/home/index?id=D1CF945D'
                },
                {
                    url:
                        "https://qjsc.oss-cn-beijing.aliyuncs.com/images/backend/gallery/2018/08/15/15343201384097.jpg",
                    herf: 'https://item.tuhu.cn/promotion/tirelist/6288e3e6-6df8-4015-890e-44f2c1b28ca1.html'
                },
                {
                    url:
                        "https://qjsc.oss-cn-beijing.aliyuncs.com/images/backend/gallery/2018/08/21/15348370751469.jpg",
                    herf: 'https://wx.tuhu.cn/vue/NaActivity/pages/home/index?id=0249209F'
                },
                {
                    url:
                        "https://qjsc.oss-cn-beijing.aliyuncs.com/images/backend/gallery/2018/06/27/15300669672702.jpg",
                    herf: 'https://item.tuhu.cn/promotion/tirelist/353a09af-05aa-492a-9d96-af3a320e505b.html'
                }
            ]

        } else if (params == 645413) {
            return [
                {
                    url:
                        "https://img2.tuhu.org/Home/Image/Fl0O9wW3d_DQW_mVWVyNZI5dM5sG_w220_h145.png",
                    herf: 'https://wx.tuhu.cn/vue/NaActivity/pages/home/index?id=D1CF945D'
                },
                {
                    url:
                        "https://img2.tuhu.org/Home/Image/1E4C8D769AE7B73EB6307057A0D3AF2B.png",
                    herf: 'https://item.tuhu.cn/promotion/tirelist/6288e3e6-6df8-4015-890e-44f2c1b28ca1.html'

                },
                {
                    url:
                        "https://img2.tuhu.org/Home/Image/382e/74f7/2d4db2b4053617d70282432a_w239_h145.png",
                    herf: 'https://wx.tuhu.cn/vue/NaActivity/pages/home/index?id=0249209F'

                },
                {
                    url:
                        "https://img2.tuhu.org/Home/Image/3529CB897EF3B5460F10A0FF2A54BF1E.png",
                    herf: 'https://item.tuhu.cn/promotion/tirelist/353a09af-05aa-492a-9d96-af3a320e505b.html'

                },
                {
                    url:
                        "https://img2.tuhu.org/Home/Image/7C62900DBFC307644B9D5E33B4CD3BD1.png",
                    herf: "https://item.tuhu.cn/promotion/activity/C3A60C25.html?id=C3A60C25&tuhu"
                }
            ]
        }
    },
    getProducts(params) {
        return axios.get(`${base.laow}/store/getProducts`, {
            params: { id: params }
        });
    }
}
export default article;
